home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / DinkClass Shareware Package / DC Template App / DHLApp.c next >
Encoding:
C/C++ Source or Header  |  1992-10-10  |  2.0 KB  |  108 lines  |  [TEXT/KAHL]

  1. /*
  2.     This is the class definition file for the DHLApp subclass of DApplication.
  3.     This class is needed to creat the correct DDocument subclass and handle
  4.     the menu options
  5.     Mark Gross 10/10/92
  6. */
  7.  
  8. #include "DHLApp.h"
  9. #include "DHLDoc.h"
  10.  
  11.  
  12. DHLApp::DHLApp(void)
  13. {
  14.     // stubb
  15. }
  16.  
  17. DHLApp::~DHLApp(void)
  18. {
  19.     // stubb
  20. }
  21.  
  22.  
  23. DDocument* DHLApp::MakeDDoc(Boolean OpenFromFile)
  24. {
  25.     DHLDoc *New;
  26.     
  27.     New = new DHLDoc;
  28.  
  29.             // if OpenFromFile == FALSE then it will 
  30.             // not read from any file
  31.     if(New->Init(OpenFromFile)) 
  32.     {
  33.         if ( fTarget = New->MakeWindow(HasColorQD()) )
  34.             ((DWindow *) fTarget)->SetWindowTitle();// everything went ok, so set the title
  35.                 // I'm having the App tell 
  36.                 // the doc to make the window because I don't 
  37.                 // like haveing one init function do too much stuff.  
  38.                 // Its a reliability thing. 
  39.         else
  40.             fTarget = New; // window not created
  41.     }
  42.     else
  43.     {
  44.         fTarget = this;
  45.         SelectWindow( FrontWindow());
  46.     }
  47.     return New;
  48. }// end of MakeDDoc member function
  49.  
  50.  
  51. void DHLApp::HandleMenuChoice(short menuID, short menuItem)
  52.  {
  53. /*
  54. PUT IN MY TEST methods when I get them implemented!!!!!!
  55.      if(menuID == rPenMenu)
  56.     {
  57.         switch(menuItem)
  58.         {
  59.             case i???:
  60.                 DoTesti???();
  61.                 break;
  62.             case i????:
  63.                 DoTesti????();
  64.                 break;
  65.             default:
  66.                 break;
  67.         }//end switch menuitem
  68.     }// end if rPenMenu
  69. */        
  70.     inherited::HandleMenuChoice(menuID, menuItem);
  71.     
  72. }// end of HandleMenuChoice member fuction
  73.             
  74.  
  75. void DHLApp::SetUpMenues(void)
  76.  {
  77.     MenuHandle    menu;
  78.     
  79. /*
  80.     menu = GetMHandle(rPenMenu);
  81.  
  82.     EnableMenuItem( menu, i1X1, TRUE);
  83.     EnableMenuItem( menu, iWhite, TRUE);
  84.  
  85.     CheckItem(menu,i1X1, ((DScribbleWind *)fDWindow)->fPenSize == 1);
  86.     CheckItem(menu, iWhite, ((DScribbleWind *)fDWindow)->fPenPat == patWhite);
  87. */
  88.     
  89.     inherited::SetUpMenues();
  90. }// end of SetUpMenues function
  91.  
  92.  
  93. void DHLApp::ClearMenus(void)
  94. {
  95.     MenuHandle    menu;
  96.     int menuItem;
  97.     
  98. /*
  99.     menu = GetMHandle(rCommMenu);
  100.     for (menuItem=1; menuItem<=CountMItems(menu); menuItem++)
  101.     {
  102.         EnableMenuItem( menu, menuItem, FALSE);
  103.     }
  104. */
  105.     inherited::ClearMenus();
  106.     
  107. }// end of clear menus member function...
  108.